<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <title>Order By</title>

    <script type="text/javascript" src="http://code.angularjs.org/angular-1.0.1.min.js"></script>
    <script type="text/javascript" src="Controller.js"></script>

</head>

<body ng-app>
    Search: <input type="text" ng-model="query">
    Sort by: 
    <select ng-model="orderbyProp">
        <option value="name">name</option>
        <option value="age">age</option>
    </select>

    <div ng-controller="PeopleController">
        <ul>
            <li ng-repeat="people in peoples | orderBy: orderbyProp | filter: query">
                name : {{people.name}} <br>
                age : {{people.age}}
            </li>
        </ul>
    </div>
</body>
</html>